# ifndef __Positioning_H_
# define __Positioning_H_

void SetPositioningStatus (const string_t & _strStatus);
void GetPositioningStatus (string_t & _ret);

struct PositionInfo_t {
	DATE  dtTime;

	// Lat/Lon in degrees.
	float fX, fY;
	// Horiz precision in meters.
	float fXYPrec;

	// Altitude (above mean sea) in meters.
	float fAltitude;
	// Vertical precision in meters.
	float fAltitudePrec;
	// Height of geoid (mean sea level) above WGS84 ellipsoid in meters.
	float fGeoidHeight;

	// Depth in meters.
	float fDepth;

	// True azimuth in degrees.
	float fAzimuth;
	// Magnetic variation in degrees (true = magnetic + variation).
	float fMagneticVariation;

	// In km/h.
	float fSpeed;
	// In m/s.
	float fVertSpeed;

	// Number of satellites.
	size_t cSatellites;

	// fix quality
	enum Fix_t {
		fixInvalid, fixUnknown,
		fix2D, fix3D, fix2D_diff, fix3D_diff,
		fixPrec, fixRTK, fixFRTK,
		fixEstimated, fixManual, fixSimulation
	};
	Fix_t Fix;

	enum def_t {
		defTime              = 0x0001,
		defXY                = 0x0002,
		defXYPrec            = 0x0004,
		defAltitude          = 0x0008,
		defAltitudePrec      = 0x0010,
		defGeoidHeight       = 0x0020,
		defDepth             = 0x0040,
		defAzimuth           = 0x0080,
		defMagneticVariation = 0x0100,
		defSpeed             = 0x0200,
		defVertSpeed         = 0x0400,
		defSatellites        = 0x0800,
		defFix               = 0x1000
	};
	DWORD dwDef;

	PositionInfo_t () : dwDef (0) {}

	void SetTime              (DATE _dt)             {dtTime = _dt;                   dwDef |= defTime;}
	void SetXY                (float _fX, float _fY) {fX = _fX; fY = _fY;             dwDef |= defXY;}
	void SetXYPrec            (float _fXYPrec)       {fXYPrec = _fXYPrec;             dwDef |= defXYPrec;}
	void SetAltitude          (float _fAltitude)     {fAltitude = _fAltitude;         dwDef |= defAltitude;}
	void SetAltitudePrec      (float _fAltitudePrec) {fAltitudePrec = _fAltitudePrec; dwDef |= defAltitudePrec;}
	void SetGeoidHeight       (float _fGeoidHeight)  {fGeoidHeight = _fGeoidHeight;   dwDef |= defGeoidHeight;}
	void SetDepth             (float _fDepth)        {fDepth = _fDepth;               dwDef |= defDepth;}
	void SetAzimuth           (float _fAzimuth)      {fAzimuth = _fAzimuth;           dwDef |= defAzimuth;}
	void SetMagneticVariation (float _fMV)           {fMagneticVariation = _fMV;      dwDef |= defMagneticVariation;}
	void SetSpeed             (float _fSpeed)        {fSpeed = _fSpeed;               dwDef |= defSpeed;}
	void SetVertSpeed         (float _fVertSpeed)    {fVertSpeed = _fVertSpeed;       dwDef |= defVertSpeed;}
	void SetSatellites        (size_t _cSatellites)  {cSatellites = _cSatellites;     dwDef |= defSatellites;}
	void SetFix               (Fix_t _Fix)           {Fix = _Fix;                     dwDef |= defFix;}
};

void PushPositionInfo (const PositionInfo_t & _pi);
void PushNoPositionInfo ();
PositionInfo_t GetPositionInfo ();

///////////////////////////////////

bool IsGPSUnitActive ();
void StartGPSUnitCommunication ();
void StopGPSUnitCommunication ();

# endif // __Positioning_H_
